package com.cskaoyan.controller.backgroundsystemcontroller;

import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.bean.vo.StatGoodsVo;
import com.cskaoyan.bean.vo.StatOrderVo;
import com.cskaoyan.bean.vo.StatUserVo;
import com.cskaoyan.service.StatisticalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: lds
 * @clsss: StatisticalReport
 */
@RestController
@RequestMapping("admin")
public class StatisticalController {

    @Autowired
    StatisticalService statisticalService;

    /**
     * @author: 刘东升
     * @title: statUser
     * @description:
     * @param: []
     * @return: com.cskaoyan.bean.vo.WxBaseRespVo
     */
    @RequestMapping("stat/user")
    public BaseRespVo statUser() {

        StatUserVo statUserVo = statisticalService.queryUser();

        return BaseRespVo.ok(statUserVo);
    }

    /**
     * @author: 刘东升
     * @title: statOrder
     * @description:
     * @param: []
     * @return: com.cskaoyan.bean.vo.WxBaseRespVo
     */
    @RequestMapping("stat/order")
    public BaseRespVo statOrder() {


        StatOrderVo statOrderVo = statisticalService.queryOrder();
        return BaseRespVo.ok(statOrderVo);
    }

    /**
     * @author: 刘东升
     * @title: statGoods
     * @description:
     * @param: []
     * @return: com.cskaoyan.bean.vo.WxBaseRespVo
     */
    @RequestMapping("stat/goods")
    public BaseRespVo statGoods() {
        StatGoodsVo statGoodsVo = statisticalService.queryGoods();
        return BaseRespVo.ok(statGoodsVo);
    }

}
